package com.zxw.设计模式.结构型.装饰器模式;

import com.zxw.设计模式.结构型.装饰器模式.实际场景中的Service方法.BaseFileDataLoder;
import com.zxw.设计模式.结构型.装饰器模式.装饰者.DataLoderDecorator;
import com.zxw.设计模式.结构型.装饰器模式.装饰者.EncryptionDataDecorator;

/**
 * @projectName: util-cloud
 * @package: com.zxw.设计模式.结构型.装饰器模式
 * @className: TEST
 * @author: zhangxuewei
 * @description: TODO
 * @date: 2023/7/1 17:52
 * @version: 1.0
 */
public class TEST {

    public static void main(String[] args) {
        String info = "name:zhangjunlin,age:2";
        DataLoderDecorator decorator = new
                EncryptionDataDecorator(new BaseFileDataLoder("demo.txt"));
        decorator.write(info);
        String data = decorator.read();
        System.out.println(data);
    }
}
